﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace lcs.Web.Controls
{
    public partial class workPlanEva : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request["workplan_id"]))
                {
                    int workplan_id = int.Parse(Request["workplan_id"]);

                    Bind(workplan_id);
                }
            }

        }

        private void Bind(int workplan_id)
        {
            DataSet ds = new Maticsoft.BLL.workplan_evaluate().GetListByVWorkPlanEva(" workplan_id= " + workplan_id + " and eva_userRole <> '绩效专责'");

            this.DataList1.DataSource = ds;
            this.DataList1.DataBind();
        }

        protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            Label lbl_info = (Label)e.Item.FindControl("lbl_info");
            Label lbl_name = (Label)e.Item.FindControl("lbl_name");
            Label lbl_time = (Label)e.Item.FindControl("lbl_time");
            Label lbl_content = (Label)e.Item.FindControl("lbl_content");
            Label lbl_result = (Label)e.Item.FindControl("lbl_result");
            Label lbl_score = (Label)e.Item.FindControl("lbl_score");
            Label lbl_userRole = (Label)e.Item.FindControl("lbl_userRole");
              
            string msg = "评价人：" + lbl_name.Text + "，评价时间： " + lbl_time.Text;

            //if (lbl_userRole.Text == "部门经理")
            //{
            //    msg += "，得分：" + lbl_score.Text;
            //}

            lbl_info.Text = msg;

          
        }

        
    }
}